package com.ggb.reactive.domain.dto

import com.fasterxml.jackson.annotation.JsonFormat
import com.ggb.reactive.domain.entity.OrderDetail
import io.swagger.v3.oas.annotations.media.Schema
import jakarta.validation.constraints.NotNull
import lombok.Data
import org.springframework.data.annotation.Id
import java.math.BigDecimal
import java.time.Instant

@Data
@Schema(title="订单提交DTO OrdersDTO")
data class OrdersDTO(
    @Id
    var id: Long? = null,
    @Schema(description = "订单号")
    var number: String? = null,
    @Schema(description = "订单状态 1待付款 2待接单 3已接单 4派送中 5已完成 6已取消 7退款")
    var status: Int? = null,
    @Schema(description = "下单用户id")
    var userId: Long? = null,
    @Schema(description = "地址id")
    var addressBookId: Long? = null,

    @Schema(description = "支付方式 1微信，2支付宝")
    var payMethod: Int? = null,

    @Schema(description = "实收金额")
    var amount: BigDecimal? = null,
    @Schema(description = "备注")
    var remark: String? = null,
    @Schema(description = "用户名")
    var userName: String? = null,
    @Schema(description = "phone")
    var phone: String? = null,
    @Schema(description = "地址")
    var address: String? = null,
    @Schema(description = "收货人")
    var consignee: String? = null,
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "下单时间")
    var orderTime: Instant? = null,
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Schema(description = "结账时间")
    var checkoutTime: Instant? = null,
    @Schema(description = "订单详情列表")
    var orderDetail:List<OrderDetail>?=null

)
